<%@ page  contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<link href="css/apps/workflow/start-work-input.css" rel="stylesheet" />

 <label>合同标题</label>
 <textarea id="title"></textarea>
 <hr />
 <button type="button" class="btn btn-primary" 
 id="doStartWork">发起流程</button>


<script type="text/javascript">
var wname = '${workflowName.workflowName}'||false;
$(function(){
	$("#doStartWork").bind("click",function(){
        if(!wname) {
            alert("请先选择工作流名称!");
            return;
        }
        var title = $("#title").text()||false;
        if(!title){
           alert("请先填写发文单标题!");
           return;
        }
		var pobj = {
				"bean.workflowName" : wname,
				"needTemplate" : true,
				"search":title
			};		
		
		
		$.post("workflow/start-work!init",$.param(pobj),function(html){
			doGet("workflow/data/query-data!inbox");			 
		});

	});

});
</script>